﻿<phone:PhoneApplicationPage 
    x:Class="Studio77.PopBall.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="ButtonStyleSoundOn" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="/Images/sound_off.png" Stretch="Fill"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleSoundOff" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="#02FFFFFF">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Source="/Images/sound_on.png" Stretch="Fill"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleClose" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid x:Name="grid" RenderTransformOrigin="0.5,0.5">
        					<Grid.RenderTransform>
        						<CompositeTransform/>
        					</Grid.RenderTransform>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
        									<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
        									<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
        									<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="Disabled"/>
        							<VisualState x:Name="MouseOver"/>
        						</VisualStateGroup>
        						<VisualStateGroup x:Name="FocusStates">
        							<VisualState x:Name="Focused"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Ellipse Width="37" VerticalAlignment="Top" Stroke="White" Height="37" HorizontalAlignment="Left" Fill="#FF890000"/>
        					<Path Width="20.254" VerticalAlignment="Center" UseLayoutRounding="False" StrokeThickness="5" Stroke="White" Stretch="Fill" Height="20.254" HorizontalAlignment="Center" Fill="#FF890000" Data="M265,10 L284.254,29.2542"/>
        					<Path Width="20.254" VerticalAlignment="Center" UseLayoutRounding="False" StrokeThickness="5" Stroke="White" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Margin="8.373" Height="20.254" HorizontalAlignment="Center" Fill="#FF890000" Data="M265,10 L284.254,29.2542">
        						<Path.RenderTransform>
        							<CompositeTransform Rotation="90"/>
        						</Path.RenderTransform>
        					</Path>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
        <Storyboard x:Name="StoryboardShowPackage">
        	<DoubleAnimation Duration="0:0:0.4" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="bdrNewUser" d:IsOptimized="True"/>
        </Storyboard>
        <Storyboard x:Name="StoryboardHidePackage">
        	<DoubleAnimation Duration="0:0:0.4" To="-800" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="bdrNewUser" d:IsOptimized="True"/>
        </Storyboard>
        <Storyboard x:Name="StoryboardVersionRound">
        	<DoubleAnimation Duration="0:0:1" To="360" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="grid" d:IsOptimized="True">
        		<DoubleAnimation.EasingFunction>
        			<CubicEase EasingMode="EaseInOut"/>
        		</DoubleAnimation.EasingFunction>
        	</DoubleAnimation>
        </Storyboard>
        <Style x:Key="ButtonStyleNewGame" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
        										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BrushMainPageTitle}"/>
        									</ObjectAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="Disabled"/>
        							<VisualState x:Name="MouseOver"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Ellipse x:Name="ellipse" Width="147" VerticalAlignment="Top" StrokeThickness="0" Stroke="Black" Height="147" HorizontalAlignment="Center" Fill="#FFEA0000"/>
        					<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" FontWeight="Bold" TextAlignment="Center" FontSize="26.667" Margin="34.788,38.03,34.211,37.97">
        						<Run Text="NEW"/>
        						<LineBreak/>
        						<Run Text="GAME"/>
        					</TextBlock>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
        <Style x:Key="ButtonStyleContinue" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
        										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BrushMainPageTitle}"/>
        									</ObjectAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="Disabled">
        								<Storyboard>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
        										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BrushMainPageTitle}"/>
        									</ObjectAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="MouseOver"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Ellipse x:Name="ellipse" Width="147" VerticalAlignment="Top" StrokeThickness="0" Stroke="Black" Height="147" HorizontalAlignment="Center" Fill="#FF00CF00"/>
        					<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Viewbox>
        <Grid x:Name="LayoutRoot" Background="{StaticResource BrushBackground}" Height="800" Width="480">
            <Image Margin="0,0,10,15" Source="/Images/logo77.png" Stretch="Fill" Width="91" Height="26" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
            <Border BorderBrush="{StaticResource BrushMainPageTitle}" BorderThickness="1" HorizontalAlignment="Center" Height="38" Margin="0,20,0,0" VerticalAlignment="Top" Width="400" Background="#33FFFFFF">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="129*"/>
                        <ColumnDefinition Width="269*"/>
                    </Grid.ColumnDefinitions>
                    <Border HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="130" Background="{StaticResource BrushMainPageTitle}" Grid.ColumnSpan="2">
                        <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="TOP SCORE" VerticalAlignment="Center" Foreground="White"/>
                    </Border>
                    <TextBlock x:Name="txtHighScore" Grid.Column="1" HorizontalAlignment="Center" TextWrapping="Wrap" Text="0" VerticalAlignment="Center" Foreground="{StaticResource BrushMainPageTitle}" FontSize="24"/>
                </Grid>
            </Border>
            <Border x:Name="bdrNewUser" BorderBrush="Black" BorderThickness="1" Margin="0" Background="#CC000000" RenderTransformOrigin="0.5,0.5" d:IsHidden="True">
            	<Border.RenderTransform>
            		<CompositeTransform TranslateY="-800"/>
            	</Border.RenderTransform>
            	<Border BorderBrush="White" BorderThickness="1" HorizontalAlignment="Center" Height="358" VerticalAlignment="Center" Width="300" Background="#7FE8E8E8" CornerRadius="10">
            		<Grid>
            			<Image Source="/Images/colorball.png" Stretch="Fill" HorizontalAlignment="Center" Width="89" Height="89" VerticalAlignment="Top" Margin="67,10,142,0"/>
            			<TextBlock HorizontalAlignment="Center" Margin="0,114,0,0" TextWrapping="Wrap" Text="Rating game with 5 stars." VerticalAlignment="Top" Foreground="#FFFFE800" FontSize="24"/>
            			<TextBlock HorizontalAlignment="Center" Margin="0,162,0,0" TextWrapping="Wrap" Text="Get the free 30 magic balls." VerticalAlignment="Top" Foreground="#FFFFE800" FontSize="24"/>
            			<Button x:Name="btnGetMB" Click="btnGetMB_Click_1" Content="Get It!" HorizontalAlignment="Center" Margin="47,275,47,0" VerticalAlignment="Top"/>
            			<Button x:Name="btnCloseGift" Click="btnCloseGift_Click_1" Content="Button" Margin="256,3,5,316" Style="{StaticResource ButtonStyleClose}"/>
            			<TextBlock HorizontalAlignment="Left" Margin="161,35,0,0" TextWrapping="Wrap" Text="×30" VerticalAlignment="Top" FontSize="48" Foreground="White"/>
            		</Grid>
            	</Border>
            </Border>
            <Canvas x:Name="canvasDots" HorizontalAlignment="Center" Height="460" Margin="0,278,0,0" VerticalAlignment="Top" Width="460" Opacity="0.5"/>
            <Grid Margin="0,100,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Width="304" Height="149">
            	<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="POP" VerticalAlignment="Top" Foreground="{StaticResource BrushMainPageTitle}" FontSize="64" FontWeight="Bold"/>
            	<TextBlock HorizontalAlignment="Left" Margin="88,63,0,0" TextWrapping="Wrap" Text="BALL" VerticalAlignment="Top" Foreground="{StaticResource BrushMainPageTitle}" FontSize="64" FontWeight="Bold"/>
            	<Grid Margin="240,76,0,9">
            		<Grid x:Name="grid" Width="64" Height="64" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
            			<Grid.RenderTransform>
            				<CompositeTransform/>
            			</Grid.RenderTransform>
            			<Ellipse Fill="#FFEA0000" StrokeThickness="0" Margin="2"/>
            			<Ellipse Fill="{StaticResource BrushMainPageTitle}" HorizontalAlignment="Left" Height="4" Margin="0" StrokeThickness="0" VerticalAlignment="Center" Width="4"/>

            		</Grid>
            		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="2" VerticalAlignment="Center" FontSize="48" FontWeight="Bold" Margin="0,0,0,5"/>

            	</Grid>

            </Grid>
            <Button x:Name="btnNewGame" Content="Button" Click="Button_Click_1" HorizontalAlignment="Center" Margin="0,308,0,345" Style="{StaticResource ButtonStyleNewGame}" VerticalAlignment="Top"/>
            <Grid Margin="167,480,166,173">
            	<Button Click="btnContinue_Click_1" x:Name="btnContinue" Content="" Style="{StaticResource ButtonStyleContinue}"/>
            	<TextBlock x:Name="txtContinue" Text="CONTINUE" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" FontWeight="Bold" TextAlignment="Center" FontSize="21.333" Margin="19,45" IsHitTestVisible="False">

            	</TextBlock>

            </Grid>

        </Grid>

    </Viewbox>

</phone:PhoneApplicationPage>